/**
 * 
 */
package com.effectivsocial.service.security;

import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;
import com.effectivsocial.domain.User;


/**
 * @author Dhrubo
 *
 */
public abstract class SecurityUtil {
	
	public static User getUserDetails() {
		SecurityContext ctx = SecurityContextHolder.getContext();
		SimpleUserDetails userDetails = (SimpleUserDetails) ctx.getAuthentication().getPrincipal();
		return userDetails.getUser();
	}
}